Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference


Chapter 9 - Script Objects

Script objects are objects that you define and use in scripts. Like the application and system objects described earlier in this manual, script objects have properties and can respond to commands. Unlike application or system objects, script objects are defined within scripts.

This chapter describes how to define and use script objects. It begins by describing a simple script object definition and demonstrating how you would send a command to the resulting script object. Subsequent sections describe in more detail how to define, send commands to, and initialize script objects.

You can define groups of script objects that share properties and handlers, and you can extend the behavior of a handler in one script object by calling it from another script object. The section "Inheritance and Delegation" describes how this works. If you are familiar with object-oriented design, you may recognize the techniques described in this section.

The last section, "Using the Copy and Set Commands With Script Objects," describes what to expect when you set a variable to a script object or copy a script object to a variable and how to write a handler that creates copies
of script objects.


Chapter Contents
About Script Objects
Defining Script Objects
Sending Commands to Script Objects
Initializing Script Objects
Inheritance and Delegation
Defining Inheritance
How Inheritance Works
The Continue Statement
Using Continue Statements to Pass Commands to Applications
The Parent Property and the Current Application
Using the Copy and Set Commands With Script Objects

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996